package org.gw.ylc.base.repositories;

import org.gw.ylc.base.model.UserInfo;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

public interface UserInfoRepository extends CrudRepository<UserInfo, String> {

	//@Query("from UserInfo u where u.uid = ?1 AND u.status = ?2")
	//public List<UserInfo> queryByUidAndStatus(String username, int status);

	@Query("from UserInfo u where u.uid = ?1 AND u.status = ?2 and (?3 is null or u.app is null or u.app=?3)")
	public List<UserInfo> findByUidAndStatusAndApp(String username, int status, String app);
}
